package com.example.test_01.model;

import org.litepal.crud.LitePalSupport;

import java.util.Date;
import java.util.List;

public class Food  extends LitePalSupport implements Comparable<Food>{
    private int id;
    private String name;
    private String foodType;
    private Date CreateTime;
    private Date UpdateTime;
    private Double price;
    private int status;
    private List<Orders> ordersList;

    public List<Orders> getOrdersList() {
        return ordersList;
    }

    public void setOrdersList(List<Orders> ordersList) {
        this.ordersList = ordersList;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFoodType() {
        return foodType;
    }

    public void setFoodType(String foodType) {
        this.foodType = foodType;
    }

    public Date getCreateTime() {
        return CreateTime;
    }

    public void setCreateTime(Date createTime) {
        CreateTime = createTime;
    }

    public Date getUpdateTime() {
        return UpdateTime;
    }

    public void setUpdateTime(Date updateTime) {
        UpdateTime = updateTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Food{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", foodTypeId='" + foodType + '\'' +
                ", CreateTime=" + CreateTime +
                ", UpdateTime=" + UpdateTime +
                ", status=" + status +
                '}';
    }

    @Override
    public int compareTo(Food food) {
        int flag = this.name.compareTo(food.name);
        if(flag > 0)
            return 1;
        else if(flag < 0)
            return -1;
        else
            return 0;
    }
}
